#
# config.mk
# from Makefile template for multi-directory
#

# cross compile...

CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
AR = $(CROSS_COMPILE)ar

ARFLAGS = cr
RM = -rm -rf
MAKE = make

CFLAGS += -Wall
debug = y

ifeq ($(debug), y)
CFLAGS += -g
else
CFLAGS += -O2 -s
endif

DEFS = -DUSE_HOSTCC

CFLAGS += $(DEFS) -DAPCLI_BOND_SUPPORT

LDFLAGS = $(LIBS) -L$(ROOTDIR)/lib/lib

# include path here
INCDIRS = -I. -I$(SRCTREE)/mgrfw/include -I$(SRCTREE)/osdep/include -I$(SRCTREE)/pfdep/include

ifneq ($(CROSS_COMPILE), )
INCDIRS += -I$(ROOTDIR)/$(LINUXDIR)/include -I$(ROOTDIR)/lib/libiwpriv -I$(ROOTDIR)/lib/libnvram \
	-I$(ROOTDIR)/$(LINUXDIR)/drivers/net/raeth -I$(ROOTDIR)/$(LINUXDIR)/drivers/char
endif

CFLAGS += $(INCDIRS)

###############################################################################

ifneq ($(OBJTREE),$(SRCTREE))
ifeq ($(CURDIR),$(SRCTREE))
dir :=
else
dir := $(subst $(SRCTREE)/,,$(CURDIR))
endif

obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)

$(shell mkdir -p $(obj))
else
obj :=
src :=
endif

suffix = $(notdir $(CURDIR))
export suffix

# export to other Makefile
export CC
export CFLAGS
export INCDIRS
export AR
export ARFLAGS
export RM

###############################################################################

